<template>
  <div class="notfound-container">
    <div class="notfound-content">
      <div class="notfound-image">
        <el-icon :size="200" color="#409eff">
          <Warning />
        </el-icon>
      </div>
      
      <div class="notfound-info">
        <h1 class="notfound-title">404</h1>
        <h2 class="notfound-subtitle">页面不存在</h2>
        <p class="notfound-description">
          抱歉，您访问的页面不存在或已被删除
        </p>
        
        <div class="notfound-actions">
          <el-button type="primary" @click="goHome">
            <el-icon><HomeFilled /></el-icon>
            返回首页
          </el-button>
          <el-button @click="goBack">
            <el-icon><Back /></el-icon>
            返回上页
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { Warning, HomeFilled, Back } from '@element-plus/icons-vue'

const router = useRouter()

// 返回首页
const goHome = () => {
  router.push('/')
}

// 返回上一页
const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.notfound-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
}

.notfound-content {
  text-align: center;
  max-width: 600px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notfound-image {
  margin-bottom: 40px;
}

.notfound-title {
  font-size: 72px;
  font-weight: 700;
  color: #409eff;
  margin: 0 0 16px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.notfound-subtitle {
  font-size: 32px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
}

.notfound-description {
  font-size: 16px;
  color: #666;
  margin: 0 0 40px 0;
  line-height: 1.6;
}

.notfound-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.notfound-actions .el-button {
  padding: 12px 24px;
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .notfound-title {
    font-size: 48px;
  }
  
  .notfound-subtitle {
    font-size: 24px;
  }
  
  .notfound-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .notfound-actions .el-button {
    width: 200px;
  }
}
</style>
